package bootstrap

import (
	"gspeed/app/model/migrate"
	"gspeed/app/utils/validate"
	"gspeed/bootstrap/global"
	"gspeed/bootstrap/modules"
)

func init() {
	global.Config = modules.Config.New()
	global.DB = modules.Orm.New()
	global.GinJwt = modules.JwtMiddleware.New()
	global.Redis = modules.Redis.NewSingle()
	global.RedisCache = modules.Redis.NewCache()
	global.Redsync = modules.Redis.NewRedsync()
	global.LocalCache = modules.LocalCache.New()
	global.Auth = modules.Auth.New()
	global.RateLimit = modules.RateLimit.New()
	global.Email = modules.Email.New()
	global.Logger = modules.Logger.NewSugaredLogger()
	global.RabbitMQ = modules.Amqp.New()
	global.Container = modules.AppContainer.New()
	global.MongoDB = modules.MongoDB.New()
	validate.Validate.Init()
	migrate.DO()
}
